package user;

import operations.*;

import java.util.Scanner;

/**
 * 管理员
 *
 * @author CY
 * @date 2022 /08/09 22:09
 */
public class Admin extends User {
//    private final Operations[] ots = new Operations[]{
//            new ExitOperations(),
//            new AddOperation(),
//            new DelOperations(),
//            new FindOperations(),
//            new DisplayOperation()
//    };

    /**
     * Instantiates a new Admin.
     *
     * @param name the name
     */
    public Admin(String name) {
        super(name);
        this.ots = new Operations[]{
                new ExitOperations(),
                new AddOperation(),
                new DelOperations(),
                new FindOperations(),
                new DisplayOperation()
        };
    }

    /**
     * Get ots operations [ ].
     *
     * @return the operations [ ]
     */
    public Operations[] getOts() {
        return ots;
    }

    @Override
    public int menu() {
        System.out.println("欢迎你，专注于写bug的管理员：" + getName());
        System.out.println("----------------------------");
        System.out.println("0.退出系统!");
        System.out.println("1.新增图书！");
        System.out.println("2.删除图书！");
        System.out.println("3.查找图书!");
        System.out.println("4.展示图书！");
        System.out.println("----------------------------");
        System.out.println("请输入你的选择：");
        Scanner sc = new Scanner(System.in);
        int choice = sc.nextInt();
        return choice;
    }

}
